<template>
  <h1>0.0</h1>
</template>

<script>
import { asyncRoutes } from '@/router'
export default {
  created() {
    // 获取模块中变量的语法：this.$store.sate.模块名.变量名
    const menus = this.$store.state.user.userInfo.roles.menus
    this.filterRouter(menus)
  },
  methods: {
    // 权限
    filterRouter(menus) {
      const newRouter = asyncRoutes.filter(item => {
        return menus.includes(item.name)
      })
      console.log('newRouter: ', newRouter)
      return newRouter
    }
  }
}
</script>

<style>

</style>
